<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" 
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
        xmlns="http://www.w3.org/1999/xhtml">
    <xsl:output method="xml" indent="yes"
        doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" 
        doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/>
    <xsl:include href="../style/theme.xsl" />
    
    <xsl:template match="content">
	<xsl:apply-templates select="data" />
    </xsl:template>
    
    <xsl:template match="content/data">
		<table border="0" width="100%" >
			<tr>
				<td>
					<xsl:apply-templates select="search-new" />
				</td>
			</tr>
			<tr align="top" >
				<td>
					<table width="100%" border="0" cellspacing="20">
						<tr>
							<td>
								<center>
								<span id="loading" style="vertical-align: middle; visibility: hidden; float: color: red;" align="center"><img src="/image/ajax-loader.gif" /></span>
								</center>
							</td>
							<!--<td style="background: #fff url('../boxbg.jpg') repeat-x top; border: 1px solid #ccc;">
								<p>Группы пользователя:&#160;</p>
								<ul>
									<xsl:for-each select="groups/item">
											<li><a href="{@href}"><xsl:value-of select="@name"/></a></li>
									</xsl:for-each>
								</ul>
							</td>
							<td style="background: #fff url('../boxbg.jpg') repeat-x top; border: 1px solid #ccc;">
								<p>Тексты пользователя</p>
							</td>
							<td style="background: #fff url('../boxbg.jpg') repeat-x top; border: 1px solid #ccc;">
								<p>Музыка пользователя</p>
							
							</td>
							<td style="background: #fff url('../boxbg.jpg') repeat-x top; border: 1px solid #ccc;">
								<p>Видео пользователя</p>
							</td>-->
							
						</tr>
				
					</table>
				</td>
			</tr>
		</table>
		</xsl:template>
		<xsl:template match="search-new">
			<style type="text/css">
				#search22 
				{
					clear: both;
					display:block;
				}
				#search22 ol
				{
					-webkit-padding-start: 40px;
					list-style-type: decimal;
					margin: 1em 0px;
					
				}
				#search22 li
				{
					clear: both;					
					background-color: white;
					border: 1px solid #DDD;
					margin-bottom: 6px;
					
					display: list-item;
										
					-moz-border-radius: 4px;
					-khtml-border-radius: 4px;
					-webkit-border-radius: 4px;
					border-radius: 4px;
					display: list-item;
					
					list-style-position: outside;
				}
				#search22 li div
				{
					display: inline-block;
					width: 100%;
				}
			</style>
			<script type="text/javascript" src="/js/core.js"></script>
			<script type="text/javascript" src="/js/ajax.js"></script>
			<script type="text/javascript" src="/js/search.js"></script>

			<script type="text/javascript">
			var query = '<xsl:value-of select="query"/>';
			//alert(query);
			//setlocation(query);
			
			</script>
			<a><xsl:value-of select="qquery"/></a>
			
			<!--<xsl:apply-templates select="document('engine.pl?s=sex%20LIKE%20!%251%25!')/search-new2" />-->
			
			<xsl:value-of select="error"/>
			<div onclick="shadow('search_form_shadow','search_button_shadow')" id="search_button_shadow" height="11px" style="height: 11px;">
				<hr style="padding: 0;margin:-1px;" />
				<img src="/image/m_open.png" align="top" style="margin: 2px 0 0 0" />
			</div>
			<div onload="checlocation();" id="search_form_shadow" style="display:none;">
				<hr style="padding: 0;margin:-1px;" />
				<table class="shadow"  style="border-top-style:none;" >
					<tr>
						<td>
							<table border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td class="td1">E-mail:</td>
									<td colspan="2"><input type="text" size="25" maxlength="100" name="email" id="email" /></td>
								</tr>
								<tr>
									<td class="td1">nic:</td>
									<td colspan="2"><input type="text" size="25" maxlength="100" name="nic" id="nic" /></td>
								</tr>
								<tr>
									<td colspan="3" class="td1">ФИО:</td>
									<td><input type="text" size="45" maxlength="100" name="name" id="name" /></td>
								</tr>
								<!--C полом отдельная песня!!!-->
								<tr>
									<td colspan="3" class="td1">Пол:</td>
									<td>Любой<input type="radio" name="sex" checked="yes" value="" id="sex0"/><span style="color: red">♀</span><input type="radio" name="sex" value="8" id="sexw"/><span style="color: blue">♂</span><input type="radio" name="sex" value="1" id="sexm"/>
									</td>
								</tr>
	
								<tr>
									<td class="td1">Возраст:</td>
									<td colspan="2">
										<select id="age_t">
											<option value="">&#160;=&#160;</option>
											<option value="m">&#160;&lt;&#160;</option>
											<option value="b">&#160;>&#160;</option>
										</select>
										<input type="text" size="2" maxlength="2" name="age" value="" id="age" /></td>
								</tr>
								<!--<tr>
									<td class="td1">Телефон:</td>
									<td colspan="2">
										+<input type="text" size="2" maxlength="4" name="phone_country" id="phone_country" value="{@country}" />
										(<input type="text" size="5" maxlength="5" name="phone_city" id="phone_city" value="{@city}" />)
										<input type="text" size="7" maxlength="7" name="phone_number" id="phone_number" value="{@number}" />
										<br />
									</td>
								</tr>-->
								<tr>
									<td class="td1">IM:</td>
									<td colspan="2">
										<input type="text" size="20" maxlength="100" name="im_{@type}" id="icq" value="{@data}"/><br />
									</td>
								</tr>
								<!--<tr>
									<td colspan="3" class="td1">О себе:<span class="imp">*</span></td>
									<td ><textarea cols="35" rows="5" name="about" id="about" ><xsl:value-of select="about"/></textarea>
									</td>
							
									<td><label id="about_message">&#160;</label></td>
								</tr>
								<tr>
									<td colspan="3" class="td1">Интересы:<span class="imp">*</span></td>
									<td><textarea cols="35" rows="5" name="interes" id="interes"><xsl:value-of select="inters"/></textarea></td>
							
									<td><label id="inters_message">&#160;</label></td>
								</tr>
								<tr>
									<td colspan="3" class="td1">Цитаты:<span class="imp">*</span></td>
									<td ><textarea cols="35" rows="5" name="citata" id="citata"><xsl:value-of select="citata"/></textarea></td>
							
									<td><label id="citata_message">&#160;</label></td>
								</tr>-->
								<tr>
									<td class="td1">Фотография: </td>
									<td colspan="2">
										С фото <input type="checkbox" name="foto" value="1" id="foto"  />
									</td>
								</tr>
							</table>
							<input type="submit" onclick="send_query();" name="send" id="send" value="Найти" />
						<div onclick="shadow('search_button_shadow','search_form_shadow')" id="search_button_shadow" height="11px" style="height: 11px;">
							<img src="/image/m_close.png" align="bottom" style="margin: 0 0 2px 0" />
						</div>
						</td>
					</tr>
				</table>
			</div>
						<script type="text/javascript">
			var query = '<xsl:value-of select="query"/>';
			//alert(query);
			checklocation();
			
			</script>
			<div id="search22">
			</div>
				<table border="0" width="100%">
					<xsl:for-each select="result/item">
							<tr>
								<td>
									<table style="border: 1px solid #CCC;" width="100%">
										<tr >
											<td rowspan="2" width="100px">
												<xsl:choose>
													<xsl:when test="@foto='0'">
														<a href="http://xepec.ru/username/index.pl?uname={@id}"><img class="left" width="100px" src="http://xepec.ru/usr/no_ava.gif" /></a>
													</xsl:when>
													<xsl:otherwise>
														<a href="http://xepec.ru/username/index.pl?uname={@id}"><img class="left" width="100px" src="http://xepec.ru/usr/{@id}/userpic-small.png" /></a>
													</xsl:otherwise>
												</xsl:choose>
											</td>
											<td>
												<h2>
													<xsl:choose>
														<xsl:when test="@sex='1'">
															<span style="color: blue">♂</span>
														</xsl:when>
														<xsl:otherwise>
															<span style="color: red">♀</span>
														</xsl:otherwise>
													</xsl:choose>
													&#160;<a href="http://xepec.ru/username/index.pl?uname={@id}"><xsl:value-of select="@nic"/></a>
												</h2>
											</td>
										</tr>
										<tr>
											<td>
												<h3><xsl:value-of select="@name"/></h3>
												<xsl:value-of select="@status"/>
											</td>
											<td>
												<h2><xsl:value-of select="@name"/></h2>
											</td>
										</tr>
									</table>
								</td>
							</tr>
					</xsl:for-each>
				</table>
			
		</xsl:template>	
	
</xsl:stylesheet>
